import request from '@/request/request'

// 创建购物车
export function createShoppingCart(data) {
    return request({
        url: '/system/shopping-cart/create',
        method: 'post',
        data: data
    })
}

// 更新购物车
export function updateShoppingCart(data) {
    return request({
        url: '/system/shopping-cart/update',
        method: 'put',
        data: data
    })
}
export function subShoppingCart(data) {
    return request({
        url: '/system/shopping-cart/submit',
        method: 'put',
        data: data
    })
}

// 删除购物车
export function deleteShoppingCart(id) {
    return request({
        url: '/system/shopping-cart/delete?id=' + id,
        method: 'delete'
    })
}

// 获得购物车
export function getShoppingCart(id) {
    return request({
        url: '/system/shopping-cart/get?id=' + id,
        method: 'get'
    })
}

// 获得购物车分页
export function getShoppingCartPage(params) {
    return request({
        url: '/system/shopping-cart/page',
        method: 'post',
        data:params
    })
}
// 导出购物车 Excel
export function exportShoppingCartExcel(params) {
    return request({
        url: '/system/shopping-cart/export-excel',
        method: 'get',
        params,
        responseType: 'blob'
    })
}